<?php

  $imageFile = $_POST['image'];
  $newRating = $_POST['rating'];
  $path = $imageFile."Rating.txt";

  $fHandle = fopen($path, 'w') or die("Cannot open file");
  fwrite($fHandle, $newRating);
  fclose($fHandle);

  echo("Thanks! the new rating is: ".$newRating);

?>